package org.tacticalTroopers.jme.server;

import org.tacticalTroopers.jme.server.object.ServerElement;

public abstract class OneShotGameAction extends BaseGameAction{
	
	Integer delay = 0;
	
	public OneShotGameAction setDelay(Integer delayInMilliseconds){
		delay = delayInMilliseconds;
		return this;
	}
	
	public void action(ServerElement element,Integer stepDuration){
		delay-=stepDuration;
		if(delay<=0){
			soleAction(element);
			element.removeAction(this);
		}
	}
	
	public abstract void soleAction(ServerElement p);

}

